package org.wesc.boot.common.utils;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 * 字符串工具类
 *
 * @author Wesley
 */
public class StringUtil {

    private static final String REGEX_NUMERIC = "[0-9]*";

    private static final Pattern PATTERN_NUMERIC = Pattern.compile(REGEX_NUMERIC);

    /**
     * 字符串是否只有数字
     * @param value 输入的字符串
     * @return true:只有数字   false:含有非数字字符
     */
    public static boolean isNumeric(String value) {
        Matcher isNum = PATTERN_NUMERIC.matcher(value);
        return isNum.matches();
    }

}
